const QQ_MAP_KEY = 'S4MBZ-VM4KI-N7VG2-5ACNR-3TZXE-TTBQY'

// 填写 env
wx.cloud.init({
  env: 'today-123'
})

/**
 *  逆经纬度查询
 * @param {*} lat
 * @param {*} lon
 */
export const geocoder = (lat, lon, success = () => {}, fail = () => {}) => {
  return wx.request({
    url: 'https://apis.map.qq.com/ws/geocoder/v1/',
    data: {
      location: `${lat},${lon}`,
      key: QQ_MAP_KEY,
      get_poi: 0
    },
    success,
    fail
  })
}


